#coding:utf8
#
# Author: CMGS
# Created on 2011-1-18
#

from common import config as _conf
from utils import feedparser as _feed

class Crawler(object):

    def __init__(self, url, timeout = _conf.CRAWLER_TIMEOUT, etag = None, modified = None):
        self._url = url
        self._etag = etag
        self._modified = modified
        self._timeout = timeout
    
    def parse(self):
        ret = _feed.parse(self._url, etag = self._etag, modified = self._modified, timeout = self._timeout)
        return ret
    
if __name__ == '__main__':
    url = u'http://www.verycd.com/sto/feed'
    c = Crawler(url, 0.1)
    print c.parse()
